#pragma once

#include "Define.h"
#include "Window.h"

#include "Events/ApplicationEvent.h"
#include "Events/WindowEvent.h"

#include "LayerStack.h"
#include "Core/ImGUI/ImGuiLayer.h"
#include "Core/Renderer/Shader.h"
#include "Core/Renderer/Buffer.h"
#include "Core/Renderer/VertexArray.h"
#include "Core/Renderer/OrthographicCamera.h"
#include "Core/Timestep.h"

namespace Origin
{
    class ORIGIN_API Application
    {
    public:
        Application();
        virtual ~Application()=default;
        void Run();
        void OnEvent(Event& e);
        void PushLayer(Layer* layer);
        void PushOverlay(Layer* layer);
        inline Window& GetWindow() { return *_window; };
        inline static Application& Get() { return *_instance; }


    private:
        static Application* _instance;

        bool OnWindowClose(WindowCloseEvent& e);
        std::unique_ptr<Window> _window;
        bool _running = true;
        LayerStack _layerStack;
        ImGuiLayer* _imGuiLayer;
        float _lastFrameTime;
    };

    Application* CreateApplication();
}
